import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/mining_redeem_rate_entity.dart';

MiningRedeemRateEntity $MiningRedeemRateEntityFromJson(
    Map<String, dynamic> json) {
  final MiningRedeemRateEntity miningRedeemRateEntity = MiningRedeemRateEntity();
  final int? rate = jsonConvert.convert<int>(json['rate']);
  if (rate != null) {
    miningRedeemRateEntity.rate = rate;
  }
  final String? keyRate = jsonConvert.convert<String>(json['keyRate']);
  if (keyRate != null) {
    miningRedeemRateEntity.keyRate = keyRate;
  }
  return miningRedeemRateEntity;
}

Map<String, dynamic> $MiningRedeemRateEntityToJson(
    MiningRedeemRateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['rate'] = entity.rate;
  data['keyRate'] = entity.keyRate;
  return data;
}

extension MiningRedeemRateEntityExt on MiningRedeemRateEntity {
  MiningRedeemRateEntity copyWith({
    int? rate,
    String? keyRate,
  }) {
    return MiningRedeemRateEntity()
      ..rate = rate ?? this.rate
      ..keyRate = keyRate ?? this.keyRate;
  }
}